import java.util.*;

public class test {
    public static void main(String[] args) {
//        String S = "abba";
//        func();
        Sort();
    }

    public boolean isSubsequence(String S, String T) {
        int lenS = S.length();
        int lenT = T.length();
        int i = 0;
        int j = 0;
        while (i < lenS && j < lenT) {
            if (S.charAt(i) == T.charAt(j)) {
                i++;
                j++;
            } else {
                j++;
            }
        }
        return i == lenS;
    }

    public static void func() {
        Scanner in = new Scanner(System.in);
        System.out.println("请输入一个字符串");
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextLine()) { // 注意 while 处理多个 case

            String str = in.nextLine();
            Stack<Character> stack = new Stack<>();
            for (int i = 0; i < str.length(); i++) {
                char ch = str.charAt(i);
                if (stack.empty() || ch != stack.peek()) {
                    stack.push(ch);
                } else {
                    stack.pop();
                }
            }
            //栈当中 已经存储好了 数据了 ca
            if (stack.empty()) {
                System.out.print("0");
            } else {
                Stack<Character> stack2 = new Stack<>();
                while (!stack.empty()) {
                    stack2.push(stack.pop());
                }
                while (!stack2.empty()) {
                    System.out.print(stack2.pop());
                }
            }
        }
    }

    public static void Sort() {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入数组大小->");
        int k = sc.nextInt();
        int[] arr = new int[k];
        for (int i = 0; i < arr.length; i++) {
            System.out.println("请输入第" + i + "个下标的值：");
            arr[i] = sc.nextInt();
        }
        Arrays.sort(arr);
        for (int x : arr) {
            System.out.print(x + " ");
        }
    }
}

